package com.syni.mdd.sjb.common.component.mybatis.community.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 企业微信群聊统计数据实体
 *
 * @author wangbaitao
 * @Date 2021-03-03
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SjbUserCount implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * 主键Id
     */
    @TableId(value = "id", type = IdType.ASSIGN_UUID)
    private String id;
    /**
     * 企业id
     */
    private String corpid;
    /**
     * 数据日期，为当日0点的时间戳
     */
    private LocalDate statTime;
    /**
     * 聊天总数
     */
    private Long chatCnt = 0L;
    /**
     * 发送消息数
     */
    private Long messageCnt = 0L;
    /**
     * 已回复聊天占比，浮点型
     */
    private Double replyPercentage = 0.0;
    /**
     * 平均首次回复时长，单位为分钟
     */
    private Long avgReplyTime = 0L;
    /**
     * 删除/拉黑成员的客户数
     */
    private Long negativeFeedbackCnt = 0L;
    /**
     * 发起申请数
     */
    private Long newApplyCnt = 0L;
    /**
     * 新增客户数
     */
    private Long newContactCnt = 0L;
    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;
    /**
     * 昨日用户总数
     */
    private Long totalCount = 0L;
    /**
     * 使用占比*聊天总数获取的已回复聊天数
     */
    @TableField(exist = false)
    private Double replyChat = 0.0;

    public static final String ID = "id";
    public static final String CORP_ID = "corpid";
    public static final String STAT_TIME = "stat_time";
    public static final String CHAT_CNT = "chat_cnt";
    public static final String MESSAGE_CNT = "message_cnt";
    public static final String REPLY_PERCENTAGE = "reply_percentage";
    public static final String AVG_REPLY_TIME = "avg_reply_time";
    public static final String NEGATIVE_FEEDBACK_CNT = "negative_feedback_cnt";
    public static final String NEW_APPLY_CNT = "new_apply_cnt";
    public static final String NEW_CONTACT_CNT = "new_contact_cnt";
    public static final String CREATE_TIME = "create_time";
    public static final String TOTAL_COUNT = "total_count";
}